package com.zhaowenhao.bean;


import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.springframework.context.annotation.Bean;

import javax.validation.constraints.Pattern;


public class Employee {

    private Integer empId;

    @Pattern(regexp = "^[\\u4E00-\\u9FA5]{1,6}$", message = "用户名必须是1-6位的中文字符")
    private String epmName;

    private String gender;

    @Email(message = "邮箱格式输入错误")
    private String email;

    private Integer dId;

    private Department department;


    public Employee() {
    }

    public Employee(String epmName, String gender, String email, Integer dId) {
        this.epmName = epmName;
        this.gender = gender;
        this.email = email;
        this.dId = dId;
    }

    public Integer getEmpId() {
        return empId;
    }

    public void setEmpId(Integer empId) {
        this.empId = empId;
    }

    public String getEpmName() {
        return epmName;
    }

    public void setEpmName(String epmName) {
        this.epmName = epmName == null ? null : epmName.trim();
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender == null ? null : gender.trim();
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }

    public Integer getdId() {
        return dId;
    }

    public void setdId(Integer dId) {
        this.dId = dId;
    }

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    @Override
    public String toString() {
        return "Employee{" +
                "empId=" + empId +
                ", epmName='" + epmName + '\'' +
                ", gender='" + gender + '\'' +
                ", email='" + email + '\'' +
                ", dId=" + dId +
                ", department=" + department +
                '}';
    }
}